package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCommodityLogMapper;
import com.ruoyi.system.domain.SysCommodityLog;
import com.ruoyi.system.service.ISysCommodityLogService;

/**
 * 订单操作记录Service业务层处理
 *
 * @author ruoyi
 * @date 2021-12-17
 */
@Service
public class SysCommodityLogServiceImpl implements ISysCommodityLogService {
    @Autowired
    private SysCommodityLogMapper sysCommodityLogMapper;

    /**
     * 查询订单操作记录
     *
     * @param id 订单操作记录主键
     * @return 订单操作记录
     */
    @Override
    public SysCommodityLog selectSysCommodityLogById(Long id) {
        return sysCommodityLogMapper.selectSysCommodityLogById(id);
    }

    /**
     * 查询订单操作记录列表
     *
     * @param sysCommodityLog 订单操作记录
     * @return 订单操作记录
     */
    @Override
    public List<SysCommodityLog> selectSysCommodityLogList(SysCommodityLog sysCommodityLog) {
        return sysCommodityLogMapper.selectSysCommodityLogList(sysCommodityLog);
    }

    /**
     * 新增订单操作记录
     *
     * @param sysCommodityLog 订单操作记录
     * @return 结果
     */
    @Override
    public int insertSysCommodityLog(SysCommodityLog sysCommodityLog) {
        sysCommodityLog.setCreateTime(DateUtils.getNowDate());
        return sysCommodityLogMapper.insertSysCommodityLog(sysCommodityLog);
    }

    /**
     * 修改订单操作记录
     *
     * @param sysCommodityLog 订单操作记录
     * @return 结果
     */
    @Override
    public int updateSysCommodityLog(SysCommodityLog sysCommodityLog) {
        return sysCommodityLogMapper.updateSysCommodityLog(sysCommodityLog);
    }

    /**
     * 批量删除订单操作记录
     *
     * @param ids 需要删除的订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteSysCommodityLogByIds(Long[] ids) {
        return sysCommodityLogMapper.deleteSysCommodityLogByIds(ids);
    }

    /**
     * 删除订单操作记录信息
     *
     * @param id 订单操作记录主键
     * @return 结果
     */
    @Override
    public int deleteSysCommodityLogById(Long id) {
        return sysCommodityLogMapper.deleteSysCommodityLogById(id);
    }
}
